<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>会员中心-我的优惠券</title>
<link rel="stylesheet" href="__PUBLIC__/Mobile/css/zhanghou.css">
<script src="__PUBLIC__/Mobile/js/jquery-1.9.1.js"></script>
<script src="__PUBLIC__/Common/Layer/layer.js"></script>
</head>

<body >
<div class="lm">
	<a href="javascript:history.back(-1);">
		<img src="__PUBLIC__/Mobile/images/return.png" style="height:22px; padding-left:2%; line-height:22px; width:6%; padding-top:2%;" class="left">
	</a>
    <span class="left size20">优惠券 </span><span style="font-size:1.5em; color:#23CC77;" onClick="empty();">清空</span>
</div>
<section>
<!--优惠券-->

  <foreach name="list" item="vo">
		<div class="coupon" style="margin-bottom:10%">
			 <img src="__PUBLIC__/Mobile/images/coupon.jpg" width="668" height="272">
			 <div class="Ticket">
			 	  <span onclick="del_coll({$vo.id})" style="border:solid 1px #23CC77; width:13%; text-align:center; height:1.6em; line-height:1.6em; float:right; color:#23CC77;" >删除</span>
				  <span class="green"><strong class="size18">￥</strong><strong class="size20">{$vo.money_youhui}</strong></span>
				  	  <span class="gray" style="margin-top:4%">
				  	  <p class="coupon-s size28">满{$vo.money_xianzhi}可用</p>
				      <p>{$vo.begin_date}-{$vo.end_date}</p>
			  	  </span>
			 </div>
		</div>
  </foreach>
  
</section>
<div class="Navigation2">
    <a href="{:U('Index/index')}" class="Navigation1-2">首页</a>
    <a href="{:U('Goods/goods_pagelist')}" class="Navigation2-1"> 分类 </a>
    <a href="{:U('Goods/goods_cart')}" class="Navigation3-1">  购物车 </a>
    <a href="{:U('Mycenter/person_center')}" class="Navigation4-1"> 我的 </a>
</div>
<script>
//清空全部记录
function empty(){
	layer.open({
	    content: '确认要全部清空吗？',
	    btn: ['确认', '取消'],
	    shadeClose: false,
	    style: 'width:80%; height:40%;',
	    yes: function(){
	    	window.location.href = "{:U('Mycenter/empty_coupon')}";
	    }
	});
}

//删除单个
function del_coll(id){
    $.post("{:U('Mycenter/del_coupon')}", { "id": id },
            function(data){
                if(data==1){
                    layer.msg('删除成功')
                    window.location.href = "{:U('Mycenter/person_coupon')}";
                }else{
                    layer.msg('删除失败');
                }
    }, "json");
}
</script>
</body>
</html>
